package com.shaoshaohuo.app.net;

/**
 * Created by yusonglin on 2015/7/9.
 * Description: net config
 */
public class HttpConfig {

    public static final ServerEnvironmentEnum serverEnvironment = ServerEnvironmentEnum.TEST;

    public static final String KEY_REQUEST = "";
    public static final String USER_AGENT = "android";

    public static final String APP_ID_USER = "1";
    public static final String APP_ID_CAR = "2";

    public static String BASE_HOST_URL = "";
    public static String BASE_SHARE = "";
    public static String BASE_TEST_URL = "";

    //http://tmet_api.tunnel.2bdata.com/
    static {
        switch (serverEnvironment) {

            case DEVELOPMENT:
                BASE_HOST_URL = "http://192.168.1.111:7777";
                BASE_SHARE = "";
                break;
            case TEST:
                BASE_HOST_URL = "http://api.tianmaoetong.com:7777";
                BASE_HOST_URL = "http://api.tianmaoetong.com:7777";
                BASE_TEST_URL = "http://api.tianmaoetong.com:7777";
                BASE_SHARE = "http://admin.eshaoshao.cn";
                break;
            case PRE_PUBLISH:
                BASE_HOST_URL = "http://api2.tianmaoetong.com";
                BASE_SHARE = "http://admin2.tianmaoetong.com";
                break;
            case ONLINE:
                BASE_HOST_URL = "http://api.tianmaoetong.com";
                BASE_SHARE = "http://admin.eshaoshao.com";
                break;
        }
    }

    public static String getRequestUrl(String subUrl) {
        return HttpConfig.BASE_HOST_URL + subUrl;
    }

    public enum ServerEnvironmentEnum {
        DEVELOPMENT, TEST, PRE_PUBLISH, ONLINE;
    }

    public static class ResponseCode {
        public static final int OK = 0;
        public static final int CODE_100 = 100;
    }


    public static class SubUrl {
        /**
         * 订单查询body参数
         */
        public static final String OrderBody(String order) {
            if (order.equals("全部")) {
                return "6";
            } else if (order.equals("待付款")) {
                return "1";
            } else if (order.equals("待发货")) {
                return "2";
            } else if (order.equals("待确认")) {
                return "3";
            } else if (order.equals("待退款")) {
                return "4";
            } else if (order.equals("已完成")) {
                return "5";
            }
            return "";
        }

        /**
         * 首页热销
         */
        public static final String HOT_SALE = "/index/hot";
        /**
         * 首页特价
         */
        public static final String SPECIAL_PRICE = "/index/bargain";
        /**
         * 首页进口
         */
        public static final String IMPORTED = "/index/importation";
        /**
         * 首页国产
         */
        public static final String DOMESTIC = "/index/domestic";
        /**
         * 模糊单条搜索
         */
        public static final String SEARCH_ITEM = "/search/item";
        /**
         * 精确搜索
         */
        public static final String SEARCH_EXECT = "/search/details";
        /**
         * 订单查询
         */
        public static final String SEARCH_ORDER = "/order/search";
        /**
         * 用于统计记录真实用户量（区别注册量）的接口
         */
        public static final String APP_START = "/index/appstart";
        /**
         * 登录
         */
        public static final String LOGIN = "/user/login";
        /**
         * 注册
         */
        public static final String REGISTER = "/register";
        /**
         * city
         */
        public static final String CITY = "/app/citycode";
        /**
         * SEND_SMS
         */
        public static final String SEND_PAY_SMS = "/account/sendsms";
        /**
         * SEND_LOGIN_SMS
         */
        public static final String SEND_LOGIN_SMS = "/sms/login";
        /**
         * GET_CAR_TYPE
         */
        public static final String GET_CAR_TYPE = "/app/carconf";
        /**
         * 获取我的用户信息
         */
        public static final String GET_USER_INFO = "/user/getmyuserinfo";
        /**
         * 上传图片
         */
        public static final String UPLOAD_IMAGE = "/upload/static";
        /**
         * 获取指定用户信息
         */
        public static final String GET_POINT_USER_INFO = "/user/getuserinfo";
        /**
         * 添加常居地
         */
        public static final String SAVE_OFTEN_ADDRESS = "/user/savereside";
        /**
         * 获取增值服务
         */
        public static final String GET_ADDED_SERVICE = "/app/attach";
        /** 保存用户信息 */
//        public static final String SAVE_MY_INFO_OLD = "/userbase/save";
        /**
         * 保存用户信息
         */
        public static final String SAVE_MY_INFO = "/userbase/usersave";
        /**
         * 删除常居地
         */
        public static final String DELETE_RESIDE = "/user/deletereside";
        /**
         * 添加常跑路线
         */
        public static final String SAVE_LINE = "/user/saveline";
        /**
         * 删除常跑路线
         */
        public static final String DELETE_LINE = "/user/deleteline";
        /**
         * 保存车辆信息
         */
        public static final String SAVE_CAR = "/user/savecar";
        /**
         * 更新车辆信息
         */
        public static final String UPDATE_CAR = "/user/modifycar";
        /**
         * 发货
         */
        public static final String SEND_GOODS = "/shipper/send";
        /**
         * 车主订单列表
         */
        public static final String CARGO_ORDER_LIST_CAR = "/orderrecord/driver";
        /**
         * 货主订单列表
         */
        public static final String CARGO_ORDER_LIST_SHIPPER = "/orderrecord/shipper";
        /**
         * 获取焦点图
         */
        public static final String GET_FOCUS_IMAGE = "/app/focus";
        /**
         * 货主获取订单详情
         */
        public static final String GET_ORDER_DETAIL = "/order/detail";
        /**
         * 货主消息列表
         */
        public static final String GET_MESSAGE_LIST = "/message/list";
        /**
         * 提醒消息
         */
        public static final String REMIND_ORDER = "/orderhandle/remind";
        /**
         * 车主订单流程确认
         */
        public static final String ORDER_PROCESS_SURE = "/orderhandle/driver";
        /**
         * 抢单司机列表
         */
        public static final String ORDER_QIANG_LIST = "/shipper/qianglist";
        /**
         * 选择抢单司机
         */
        public static final String SELECT_GRAB_DRIVER = "/shipper/changedriver";
        /**
         * 账户情况 余额
         */
        public static final String ACCOUNT_DETAIL = "/account/detail";
        /**
         * 确定支付
         */
        public static final String PAY_CONFIM = "/pay/index";
        /**
         * 我要找车
         */
        public static final String SEARCH_CAR = "/search/car";
        /**
         * 车主 同意 拒绝 接单
         */
        public static final String DRIVER_OPERATE = "/driver/operate";

        /**
         * 发表评价
         */
        public static final String DISCUSS_SEND = "/discuss/send";
        /**
         * 获取评论列表
         */
        public static final String GET_EVALUATION_LIST = "/discuss/list";
        /**
         * 我要找货
         */
        public static final String SEARCH_CARGO = "/search/cargo";
        /**
         * 车主抢单
         */
        public static final String DRIVER_QIANG = "/driver/qiang";
        /**
         * 上报经纬度
         */
        public static final String REPORT_GEO = "/app/reportgeo";

        /**
         * 首页接口
         */
        public static final String MAIN_INDEX = "/index/index";
        /**
         * 发货 一车驱动
         */
        public static final String SEND_GOODS_BY_CAR = "/shipper/changecar";
        /**
         * 代金券列表
         */
        public static final String GET_COUPON_LIST = "/coupon/cachlist";
        /**
         * 收支明细
         */
        public static final String PAY_FLOW = "/pay/flow";
        /**
         * 积分列表
         */
        public static final String POINT_LIST = "/integral/list";
        /**
         * 商城积分兑换列表
         */
        public static final String POINT_MALL_LIST = "/integral/goodslist";
        /**
         * 兑换商品详情
         */
        public static final String POINT_GOODS_DETAIL = "/integral/goodsdetail ";
        /**
         * 兑换商品
         */
        public static final String EXCHANGE_GOODS = "/integral/exchangegoods";
        /**
         * 兑换记录
         */
        public static final String EXCHANGE_GOODS_RECORD = "/integral/exchangerecord";
        /**
         * 支持的提现方式
         */
        public static final String SUPPORT_WITHDRAW = "/wallet/supportbind";
        /**
         * 提现
         */
        public static final String WITHDRAW = "/wallet/withdraw";
        /**
         * 充值
         */
        public static final String RECHANGE = "/pay/recharge";
        /**
         * 修改支付密码
         */
        public static final String RESET_PWD = "/account/updatepasswd";
        /**
         * 设置支付密码 验证码
         */
        public static final String FORGOT_PWD = "/account/setpasswd";
        /**
         * 意见反馈
         */
        public static final String FEED_BACK = "/feedback/submit";

        /**
         * 新闻列表
         */
        public static final String NEWS_LIST = "/news/list";
        /**
         * 工具箱
         */
        public static final String APP_TOOLS = "/app/tools";
        /**
         * push上报接口
         */
        public static final String PUSH_ONLINE = "/push/online2";
        /**
         * push上报接口
         */
        public static final String PUSH_OFFLINE = "/push/offline2";

        //---------EC-----------

        /**
         * 电商获取产品分类
         */
        public static final String EC_CATEGORY = "/ec_category/index";
        /**
         * 电商获取产品品种
         */
        public static final String EC_CATEGORY_VARIETY = "/ec_category/getvariety";
        /**
         * 电商首页推荐数据
         */
        public static final String EC_MAIN_INDEX = "/ec_index/index";
        /**
         * 获取市场
         */
        public static final String EC_MARKET_SEARCH = "/ec_market/search";
        /**
         * 设置用户角色
         */
        public static final String USER_SET_ROLE = "/user/setrole";
        /**
         * 我要买
         */
        public static final String PURCHASE_PUBLISHED = "/ec_purchase/published";
        /**
         * 自己发布采购列表
         */
        public static final String PURCHASE_PUBLISHED_MYLIST = "/ec_purchase/mylist";
        /**
         * 我要卖
         */
        public static final String SUPPLY_PUBLISH = "/ec_supply/publish";
        /**
         * 我的列表供应
         */
        public static final String SUPPLY_PUBLISH_MYLIST = "/ec_supply/mylist";
        /**
         * 列表供应
         */
        public static final String SUPPLY_PUBLISH_LIST = "/ec_supply/list";
        /**
         * 供应详情
         */
        public static final String SUPPLY_DETAIL = "/ec_supply/detail";
        /**
         * 采购详情
         */
        public static final String PURCHASE_DETAIL = "/ec_purchase/detail";
        /**
         * 采购订单详情
         */
        public static final String PURCHASE_ORDER_DETAIL = "/ec_purchase/orderdetail";
        /**
         * 添加供应订单
         */
        public static final String SUPPLY_ORDER_ADD = "/ec_supplyorder/add";
        /**
         * 供应订单支付
         */
        public static final String EC_ORDER_PAY = "/ec_pay/index";
        /**
         * 供应订单列表
         */
        public static final String EC_SUPPLY_ORDER_LIST = "/ec_supplyorder/list";
        /**
         * 采购订单列表
         */
        public static final String EC_PURCHASE_ORDER_LIST = "/ec_purchase/orderlist";
        /**
         * 采购订单报价列表
         */
        public static final String EC_PURCHASE_QUOTE_LIST = "/ec_purchase/quotelist";
        /**
         * 采购报价
         */
        public static final String EC_PURCHASE_QUOTE = "/ec_purchase/quote";
        /**
         * 报价详情
         */
        public static final String EC_PURCHASE_QUOTE_DETAIL = "/ec_purchase/quotedetail";
        /**
         * 取消供应订单
         */
        public static final String SUPPLY_ORDER_CANCEL = "/ec_supplyorder/cancel";
        /**
         * 供应订单详情
         */
        public static final String SUPPLY_ORDER_DETAIL = "/ec_supplyorder/detail";
        /**
         * 采购大厅
         */
        public static final String PURCHASE_ORDER_LIST = "/ec_purchase/list";
        /**
         * 找卖家
         */
        public static final String FIND_SELLER = "/ec_business/index";
        /**
         * 发布商机
         */
        public static final String BUSINESS_PUBLISH = "/ec_business/publish";
        /**
         * 找买家
         */
        public static final String FIND_BUYERS = "/ec_business/buyers";
        /**
         * 找买家详情
         */
        public static final String FIND_BUYERS_DETAIL = "/ec_business/buyerdetail";
        /**
         * 找买家详情
         */
        public static final String FIND_BUYERS_MORE = "/ec_business/marketmorebuyer";
        /**
         * 3.5大客户信息保存认证(货主 电商 )
         */
        public static final String USER_INFO_BIGCUSTOMER_SAVE = "/userbase/bigcustomer";
        /**
         * 3.5货栈信息保存认证(货主)
         */
        public static final String USER_INFO_WAREHOUSE_SAVE = "/userbase/warehouse";
        /**
         * 历史商机列表
         */
        public static final String BUSINESS_HISTORY = "/ec_business/mylist";
        /**
         * 市场详情
         */
        public static final String MARKET_DETAIL = "/ec_market/detail";
        /**
         * 卖家详情
         */
        public static final String SELLER_DETAIL = "/ec_business/detail";
        /**
         * 选中报价
         */
        public static final String PURCHASE_SELECTSUPPLY = "/ec_purchase/selectsupply";
        /**
         * 搜索
         */
        public static final String SEARCH_LIST = "/ec_search/list";
        /**
         * 删除商机
         */
        public static final String DELETE_BUSINESS = "/ec_business/delete";
        /**
         * 取消采购订单
         */
        public static final String PURCHASE_ORDER_CANCEL = "/ec_purchaseorder/cancel";
        /**
         * 采购订单确认收货
         */
        public static final String PURCHASE_ORDER_RECEIVER_GOODS = "/ec_purchaseorder/receivegoods";
        /**
         * 采购订单确认收货
         */
        public static final String SUPPLY_QUOTE_MY_DETAIL = "/ec_purchase/orderquotedetail";
        /**
         * 删除采购订单
         */
        public static final String DELETE_PURCHASE_ORDER = "/ec_purchaseorder/delete";
        /**
         * 删除供应订单
         */
        public static final String DELETE_SUPPLY_ORDER = "/ec_supplyorder/delete";
        /**
         * 供应订单发货
         */
        public static final String SEND_SUPPLY_ORDER = "/ec_supplyorder/sendgoods";
        /**
         * 供应订单提醒
         */
        public static final String SUPPLY_ORDER_REMIND = "/ec_remind/supplyorder";
        /**
         * 评论电商订单
         */
        public static final String EC_DISCUSS_SEND = "/ec_discuss/send";
        /**
         * 货主订单流程处理
         */
        public static final String SHIPPER_ORDER_HANDLER = "/orderhandle/shipper";
        /**
         * 检查是否设置过支付密码
         */
        public static final String CHECK_PAY_PWD = "/account/checkpasswd";
        /**
         * 浏览记录
         */
        public static final String BROWSE_RECORD = "/ec_supply/userbrowse";
        /**
         * 市场行情
         */
        public static final String MARKET_PRICE = "/ec_supply/marketList";
        /**
         * 常用收货地址获取
         */
        public static final String OFTEN_ADDRESS = "/receivingaddress/list";
        /**
         * 增加收获地址
         */
        public static final String ADD_ADDRESS = "/receivingaddress/add";
        /**
         * 删除收获地址
         */
        public static final String DELETE_ADDRESS = "/receivingaddress/delete";
        /**
         * 设置默认收货地址
         */
        public static final String DEFAULT_ADDRESS = "/receivingaddress/setdefault";
        /**
         * 获取默认收货地址
         */
        public static final String GET_DEFAULT_ADDRESS = "/receivingaddress/getdefault";
        /**
         * 支付 详情
         */
        public static final String INCOME_STATEMENT = "/pay/flow1_4";
        /**
         * 签到
         */
        public static final String USER_SIGN = "/user/usersign";
        /**
         * 签到
         */
        public static final String USER_SIGN_POINT = "/user/usersignpoint";

        //-----------电商购物车-----------
        /**
         * 电商商品放入购物车
         */
        public static final String EC_CART_ADD = "/ec_shoppingcart/add";
        /**
         * 电商购物车列表
         */
        public static final String EC_CART_LIST = "/ec_shoppingcart/list";
        /**
         * 从电商购物车删除商品
         */
        public static final String EC_CART_DELETE = "/ec_shoppingcart/delete";
        /**
         * 电商下单，同时支持直接下单与购物车下单
         */
        public static final String EC_CART_ORDER = "/ec_shoppingcart/createorder";
        /**
         * 我要买 新增 支持多个商品 发布
         */
        public static final String PURCHASE_PUBLISHED_MORE = "/ec_purchase/PublishedMore";
        /**
         * 分享送积分
         */
        public static final String SHARE_GET_SCORE = "/share/integral";
        /**
         * 版本更新
         */
        public static final String CHECK_VERSION = "/app/appversionInfo";

        /**
         * 绑定银行卡列表
         */
        public static final String PAY_ACCOUNT_LIST = "/wallet/bindlist";
        /**
         * 绑定银行卡
         */
        public static final String ADD_PAY_ACCOUNT = "/wallet/bind";
        /**
         * 解绑银行卡
         */
        public static final String DELETE_PAY_ACCOUNT = "/wallet/unbind";
        /**
         * 设置默认银行卡
         */
        public static final String SET_DEFAULT_ACCOUNT = "/wallet/binddefault";
        /**
         * 绑定银行卡提现
         */
        public static final String APPLY_FOR_ACCOUNT = "/wallet/applyfor";

        /**
         * 用户发布的货源列表
         */
        public static final String PUBLISHED_GOODS_LIST = "/shipper/mylist";

        /**
         * 刷新置顶用户发布的货源
         */
        public static final String PUBLISHED_GOODS_ITEM_FRESH = "/shipper/refresh";
        /**
         * 编辑用户发布的货源
         */
        public static final String PUBLISHED_GOODS_ITEM_EDIT = "/shipper/edit";
        /**
         * 修改用户发布的货源
         */
        public static final String PUBLISHED_GOODS_ITEM_DELETE = "/shipper/delete";
        /**
         * 发布的采购记录刷新
         */
        public static final String PUBLISHED_PURCHASE_RECORED_REFRESH = "/ec_purchase/refresh";
        /**
         * 发布的采购记录编辑
         */
        public static final String PUBLISHED_PURCHASE_RECORED_EDIT = "/ec_purchase/edit";
        /**
         * 发布的采购记录删除
         */
        public static final String PUBLISHED_PURCHASE_RECORED_DELETE = "/ec_purchase/delete";
        /**
         * 发布的供应记录删除
         */
        public static final String PUBLISHED_SUPPLY_RECORED_DELETE = "/ec_supply/delete";
        /**
         * 发布的供应记录刷新
         */
        public static final String PUBLISHED_SUPPLY_RECORED_REFRESH = "/ec_supply/refresh";
        /**
         * 发布的供应记录编辑
         */
        public static final String PUBLISHED_SUPPLY_RECORED_EDIT = "/ec_supply/edit";
        /**
         * 我的报价  接口
         */
        public static final String MY_PRICE = "/ec_purchase/myQuoteList";

        /**
         * 货主找到车后，给车下单
         */
        public static final String SHIPPER_CHOOSE_CAR = "/shipper/chooseCarUser";
        /**
         * 修改报价
         */
        public static final String MODIFY_PRICE = "/ec_purchase/updateMyQuote";
        /**
         * 取消我的报价
         */
        public static final String CANCEL_PRICE = "/ec_purchase/deleteMyQuote";

        /**
         * 根据 品种 获取  此品种对应的规格
         */
        public static final String GET_SPECIFICATION = "/ec_category/getSpecification";
        /**
         * 实名认证
         */
        public static final String AUDIT_REAL_NAME = "/userbase/auditUserRealname";
        /**
         * 品牌直营，准入资料申请
         */
        public static final String BRAND_SCOPE_APPLY = "/userbase/brandScopeApply";

    }

    public static final class WebPage {
        public static final String REGISTER_AGREEMENT = HttpConfig.BASE_HOST_URL + "/h5/protocol";
        public static final String ABOUT = HttpConfig.BASE_HOST_URL + "/h5/about";
        public static final String GUIDE = HttpConfig.BASE_HOST_URL + "/h5/guide";
        public static final String SHARE = HttpConfig.BASE_HOST_URL + "/share/myShareUrl";
        public static final String SHARE_IMAGE_PATH = "http://static.eshaoshao.com/images/logo.png";
        public static final String SHARE_SITE = "田贸e通";
        public static final String SHARE_SITE_URL = "http://www.tianmaoetong.com";
        public static final String DOWNLOAD_APP = "http://123.56.115.117:8080/shaoshao_apply/download/app_download_transfer";
        public static final String SHARE_PURCHASE = HttpConfig.BASE_SHARE + "/index/sharepurchase";
        public static final String SHARE_SUPPLY = HttpConfig.BASE_SHARE + "/index/sharesupply";

    }


}